package com.metrics.objects;

import java.io.Serializable;
import java.math.BigDecimal;

import com.database.objects.*;

public class Options implements Serializable {

	private static final long serialVersionUID = 6776758463996150595L;

	public static final String START_DATE_DEFAULT = "1900-01-01";

	public static final String FINISH_DATE_DEFAULT = "3000-01-01";

	private static final BigDecimal PERCENT_DEFAULT = new BigDecimal(100);

	private static final Time TIME_DEFAULT = Time.DAY;

	private Graphic graphic;

	private Metric metric;

	private Type type;

	private Status status;

	private String start;

	private String finish;

	private Time time;

	private BigDecimal percent;

	private boolean orderByName;

	private String nameDeveloper;

	public Options(Graphic graphic, Metric metric, Type type, Status status, String start, String finish, Time time, BigDecimal percent, boolean orderByName, String nameDeveloper) {
		this.graphic = graphic;
		this.metric = metric;
		this.type = type;
		this.status = status;
		this.start = start;
		this.finish = finish;
		this.time = time;
		this.percent = percent;
		this.orderByName = orderByName;
		this.nameDeveloper = nameDeveloper;
	}

	public Graphic getGraphic() {
		return graphic;
	}

	public Metric getMetric() {
		return metric;
	}

	public Type getType() {
		return type;
	}

	public Status getStatus() {
		return status;
	}

	public String getStart() {
		return start != null && !start.equals("") ? start : START_DATE_DEFAULT;
	}

	public String getFinish() {
		return finish != null && !finish.equals("") ? finish : FINISH_DATE_DEFAULT;
	}

	public Time getTime() {
		return time != null ? time : TIME_DEFAULT;
	}

	public BigDecimal getPercent() {
		return percent != null ? percent : PERCENT_DEFAULT;
	}

	public boolean isOrderByName() {
		return orderByName;
	}

	public String getNameDeveloper() {
		return nameDeveloper != null ? nameDeveloper : "";
	}

	@Override
	public String toString() {
		return "Options [finish=" + finish + ", graphic=" + graphic + ", metric=" + metric + ", nameDeveloper=" + nameDeveloper + ", orderByName=" + orderByName + ", percent=" + percent + ", start=" + start + ", status=" + status + ", time=" + time
				+ ", type=" + type + "]";
	}

}
